getApp();

var t = require("../../utils/data.js");

Page({
    data: {
        class_num: null,
        artype: null
    },
    onLoad: function(a) {
        console.log("传送过来");
        n = this;
        if (a.artype) this.setData({
            artype: a.artype
        }); else {
            console.log("从缓存中");
            var e = wx.getStorageSync("cnum");
            this.setData({
                artype: e
            });
        }
        var n = this;
        console.log(this.data.artype), wx.request({
            url: t.getInterfaceData() + "mentioncountinfor.action",
            data: {
                cnum: this.data.artype
            },
            header: {
                "content-type": "application/json"
            },
            success: function(t) {
                n.setData({
                    list: t.data
                }), console.log(t.data);
            }
        });
    },
    onReady: function() {},
    mdDetail: function(t) {
        console.log(t.currentTarget.dataset.aid), console.log(this.data.artype), console.log(t.currentTarget.dataset.infotype), 
        wx.navigateTo({
            url: "../info/info?nid=" + t.currentTarget.dataset.aid + "&cnum=" + this.data.artype + "&infotype=" + t.currentTarget.dataset.infotype
        });
    },
    scDetail: function(a) {
        console.log("从缓存中");
        var e = this, n = wx.getStorageSync("cnum");
        wx.showModal({
            title: "确定删除？",
            content: "此操作不可恢复",
            success: function(o) {
                o.confirm ? (console.log("用户点击确定"), wx.request({
                    url: t.getInterfaceData() + "deletemcountinfor.action",
                    data: {
                        cnum: n,
                        nid: a.currentTarget.dataset.aid
                    },
                    header: {
                        "content-type": "application/json"
                    },
                    success: function(t) {
                        e.setData({
                            list: t.data
                        }), console.log(t.data);
                    }
                })) : o.cancel && console.log("用户点击取消");
            }
        });
    },
    onShow: function() {
        console.log("传送过来");
        var a = this;
        console.log("从缓存中");
        var e = wx.getStorageSync("cnum");
        this.setData({
            artype: e
        }), console.log(this.data.artype), wx.request({
            url: t.getInterfaceData() + "mentioncountinfor.action",
            data: {
                cnum: this.data.artype
            },
            header: {
                "content-type": "application/json"
            },
            success: function(t) {
                a.setData({
                    list: t.data
                }), console.log(t.data);
            }
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});